package com.pk.platform.business.privilege.web;

import java.util.ArrayList;
import java.util.List;

import com.pk.platform.business.common.service.IKindergartenService;
import com.pk.platform.business.core.web.GenericAction;
import com.pk.platform.business.privilege.service.IMenuService;
import com.pk.platform.business.privilege.vo.MenuVO;
import com.pk.platform.domain.common.Kindergarten;
import com.pk.platform.domain.privilege.Menu;
import com.pk.platform.domain.privilege.User;
import com.pk.platform.util.WebUtil;

public class CommonAction extends GenericAction {

	private User user = new User();
	
	private IMenuService menuService;
	
	private String tree;
	
	private List<Menu> menuList = new ArrayList<Menu>();
	
	private MenuVO mvo = new MenuVO();
	
	private Menu menu = new Menu();
	
	private IKindergartenService kindergartenService;
	
	private List<Kindergarten> kgList = new ArrayList<Kindergarten>();
	
	public String menuChange()
	{
		if(mvo.getMenu().getId() != null)
		{
			tree = menuService.getMenuTreeById(mvo.getMenu().getId().toString());
			menu = menuService.queryMenuById(mvo.getMenu().getId());
		}
		return SUCCESS;
	}
	
	public String top()
	{
		user = this.getLoginUser();
		menuList = menuService.queryTopMenu(new Long(1));
		kgList = kindergartenService.queryAllKgList();
		return SUCCESS;
	}
	
	public String right()
	{
		return SUCCESS;
	}
	
	public String bottom()
	{
		return SUCCESS;
	}
	
	public String welcome()
	{
		return SUCCESS;
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public IMenuService getMenuService() {
		return menuService;
	}

	public void setMenuService(IMenuService menuService) {
		this.menuService = menuService;
	}

	public List<Menu> getMenuList() {
		return menuList;
	}

	public void setMenuList(List<Menu> menuList) {
		this.menuList = menuList;
	}

	public String getTree() {
		return tree;
	}

	public void setTree(String tree) {
		this.tree = tree;
	}

	public MenuVO getMvo() {
		return mvo;
	}

	public void setMvo(MenuVO mvo) {
		this.mvo = mvo;
	}

	public Menu getMenu() {
		return menu;
	}

	public void setMenu(Menu menu) {
		this.menu = menu;
	}

	public IKindergartenService getKindergartenService() {
		return kindergartenService;
	}

	public void setKindergartenService(IKindergartenService kindergartenService) {
		this.kindergartenService = kindergartenService;
	}

	public List<Kindergarten> getKgList() {
		return kgList;
	}

	public void setKgList(List<Kindergarten> kgList) {
		this.kgList = kgList;
	}

}
